package com.yulongtian.weekCompetition.month202301.week03;

import java.util.Arrays;

/**
 * 可
 *
 * @author yulongTian
 * @create 2023-01-15 10:40
 */
public class Test02 {
    public static void main(String[] args) {
        System.out.println(Arrays.deepToString(rangeAddQueries(3, new int[][]{{1, 1, 2, 2}, {0, 0, 1, 1}})));
    }

    public static int[][] rangeAddQueries(int n, int[][] queries) {
        int[][] grid = new int[n][n];

        for (int[] ints : grid) {
            for (int anInt : ints) {
                anInt = 0;
            }
        }

        for (int[] query : queries) {
            int i1 = query[0];
            int i2 = query[2];
            int j1 = query[1];
            int j2 = query[3];

            for (int i = i1; i <= i2; i++) {
                for (int j = j1; j <= j2; j++) {
                    grid[i][j] += 1;
                }
            }

        }
        return grid;
    }

}
